setTextHorizontalAlignment

abstract fun setTextHorizontalAlignment(block: DesignBlock, alignment: HorizontalAlignment?, paragraphIndex: Int = -1)

Sets the paragraph-level horizontal alignment override for one or all paragraphs of a text block. Required scope: "text/character"

Parameters

block

the text block to modify.

alignment

the alignment override to apply. Pass null to clear a paragraph-level override.

paragraphIndex

the 0-based index of the paragraph to modify. Negative values clear all paragraph-level alignment overrides and, when alignment is non-null, apply that alignment to the whole text block.